<? $document=$document->getFirstChild(); ?>

<course>
	<variable id="marketingMessage"><![CDATA[{
		<? foreach($document->getChildByTitle("Feedback Messages")->getChildrenByTitle("Marketing") as $i=>$message) { ?>
			<? if($i!=0) echo " else "; ?>
			<? if ($message->hasAttribute("condition")) { ?>
				if (<? echo $message->getAttribute("condition"); ?>)
			<? } ?>
				"<? echo $message->getBody(); ?>"
		<? } ?>
	}]]></variable>

	<variable id="customerCareMessage"><![CDATA[{
		<? foreach($document->getChildByTitle("Feedback Messages")->getChildrenByTitle("CustomerCare") as $i=>$message) { ?>
			<? if($i!=0) echo " else "; ?>
			<? if ($message->hasAttribute("condition")) { ?>
				if (<? echo $message->getAttribute("condition"); ?>)
			<? } ?>
				"<? echo $message->getBody(); ?>"
		<? } ?>
	}]]></variable>

	<variable id="pricingMessage"><![CDATA[{
		<? foreach($document->getChildByTitle("Feedback Messages")->getChildrenByTitle("Pricing") as $i=>$message) { ?>
			<? if($i!=0) echo " else "; ?>
			<? if ($message->hasAttribute("condition")) { ?>
				if (<? echo $message->getAttribute("condition"); ?>)
			<? } ?>
				"<? echo $message->getBody(); ?>"
		<? } ?>
	}]]></variable>
</course>